<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>雷达图</title>
    <style>
        #main {
            width: 700px;
            height: 500px;
        }
    </style>
</head>
<body>

<div id="main"></div>

<script src="http://lib.baomitu.com/echarts/4.7.0/echarts.min.js">

</script>

<script>
    const myChart = echarts.init(document.getElementById('main'))

    const data = [
        {
            name: '关羽',
            value: [80, 90, 80, 70, 70]
        },
        {
            name: '鲁班',
            value: [85, 70, 75, 95, 80]
        }
    ]

    const option = {
        title: {
            text: '仪表盘',
        },

        legend: {},

        series: {
            id: 1,
            type: 'gauge',
            detail: {
                formatter: '{value}km/h',
            },
            data: [
                {
                    name: '速度',
                    value: 90
                }
            ],
        }
    }

    myChart.setOption(option)

    setInterval(function () {
        myChart.setOption({
            series: [{
                id: 1,
                data: [{
                    name: '速度',
                    value: Math.round(Math.random() * 100)
                }],
            }]
        })
    }, 1000)
</script>
</body>
</html>
